home *** CD-ROM | disk | FTP | other *** search
- WBStartup
-
- WBenchToFront_
-
- NoCli
-
- WbToScreen 1 ;we use WB for mode requester
-
- LoadFont 0,"topaz.font",8 ;load test screen's font
- *fn=Addr IntuiFont (0) ;pointer to screen font
-
-
-
- NEWTYPE.SMode ;for the mode requester
- DisplayID.l
- DisplayWidth.l
- DisplayHeight.l
- DisplayDepth.w
- OverscanType.w
- End NEWTYPE
-
- sm$="Select A Screen Mode:" ;title for mode requester
-
- If NTSC=True ;set default screen mode
- imode.l=$19004 ;NTSC hi-res lace for NTSC
- iheight.w=400
- Else
- imode.l=$29004 ;PAL hi-res laced for PAL
- iheight.w=512
- EndIf
-
- Dim SMRtags.TagItem(19) ;taglist for mode requester
-
- SMRtags(0)\ti_Tag=#ASLSM_InitialLeftEdge,160 ;these are the position for the
- SMRtags(1)\ti_Tag=#ASLSM_InitialTopEdge,10 ;screenmode requester
- SMRtags(2)\ti_Tag=#ASLSM_InitialWidth,320
- SMRtags(3)\ti_Tag=#ASLSM_InitialHeight,200
- SMRtags(4)\ti_Tag=#ASLSM_InitialDisplayID,imode ;these are shown as "selected"
- SMRtags(5)\ti_Tag=#ASLSM_InitialDisplayDepth,3 ;when the requester opens
- SMRtags(6)\ti_Tag=#ASLSM_InitialDisplayWidth,640
- SMRtags(7)\ti_Tag=#ASLSM_InitialDisplayHeight,iheight
- SMRtags(8)\ti_Tag=#ASLSM_InitialOverscanType,1
- SMRtags(9)\ti_Tag=#ASLSM_InitialInfoOpened,0 ;no "properties" window
- SMRtags(10)\ti_Tag=#ASLSM_DoDepth,1 ;0 for no depth selector
- SMRtags(11)\ti_Tag=#ASLSM_DoOverscanType,1 ;0 for no OverScan selector
- SMRtags(12)\ti_Tag=#ASLSM_DoWidth,1 ;0 for no width gadget
- SMRtags(13)\ti_Tag=#ASLSM_DoHeight,1 ;0 for no height gadget
- SMRtags(14)\ti_Tag=#ASLSM_MinHeight,200 ;minimum height allowed
- SMRtags(15)\ti_Tag=#ASLSM_MinWidth,320 ;minimum width allowed
- SMRtags(16)\ti_Tag=#ASLSM_MinDepth,3 ;minimum depth allowed
- SMRtags(17)\ti_Tag=#ASLSM_TitleText,&sm$ ;pointer to requester title$
- SMRtags(18)\ti_Tag=#TAG_DONE
-
- ;
- ; ScreenMode requester returns the ScreenMode structure
- ;
-
- *sreq.SMode=0
- *sreq=AllocAslRequest_(2,&SMRtags(0)\ti_Tag)
- ok.b=AslRequest_(*sreq,&SMRtags(0)\ti_Tag)
-
- If ok<>0 ;if 0, the cancel gadget was hit
-
- ;------- read the results into variables
- ;this part is not really necessary, but makes it possible to
- ;just make up the screen without using the requester every time
- ;the program is started
- ;these results could be saved into a "prefs" file
- ;and reloaded into your program before opening the screen
-
- Display.l=*sreq\DisplayID
- Oscan.w=*sreq\OverscanType
- Dpth.w=*sreq\DisplayDepth
- Widh.l=*sreq\DisplayWidth
- Heit.l=*sreq\DisplayHeight
-
- ;------- now make the "Program's" screen --------------------
- ; we will make it up in back and pop to the front when ready
-
-
- Dim SCRtags.TagItem(12)
- SCRtags(0)\ti_Tag=#SA_DisplayID,Display
- SCRtags(1)\ti_Tag=#SA_Overscan,Oscan
- SCRtags(2)\ti_Tag=#SA_Depth,Dpth
- SCRtags(3)\ti_Tag=#SA_Width,Widh
- SCRtags(4)\ti_Tag=#SA_Height,Heit
- SCRtags(5)\ti_Tag=#SA_Top,0
- SCRtags(6)\ti_Tag=#SA_Left,0
- SCRtags(7)\ti_Tag=#SA_AutoScroll,1 ;autoscroll is on!
- SCRtags(8)\ti_Tag=#SA_Pens,?DriPens ;List of 13 Dripens
- SCRtags(9)\ti_Tag=#SA_Behind,1 ;make screen in back of display
- SCRtags(10)\ti_Tag=#SA_ShowTitle,0
- SCRtags(11)\ti_Tag=#TAG_DONE
-
- ScreenTags 0,"Test Screen",& SCRtags(0) ;open the test screen
-
- Window 1,10,10,300,100,$1000|$8,"Screen info",1,0 ;and a small window
- NPrint "$"+Hex$(Display)
- NPrint "Depth=",Dpth
- NPrint "Press close gadget to end"
-
- ShowScreen 0 ;now bring screen to the front
-
-
- Repeat ;just wait until the window
- ev.l=WaitEvent ;close gadget is pressed
- Until ev=$200
-
-
- Else
- Request "","Cancelled!","OK"
- End
- EndIf
- If (*sreq) Then FreeAslRequest_(*sreq) ;we MUST free this ourselves
-
-
- End
-
- Even
- DriPens
- Dc.w 0,1,1,2,1,3,1,0,2,1,2,1,-1
-
-
-
-